nodes.forEach((node) => {
    const flowNode: FlowNode = {
        id: node.id,
        type: 'jdf', // Restore custom node type
        // type: 'default', // Use default node for debugging
        position: { x: node.x ?? 0, y: node.y ?? 0 },
        data: {
            // label: `${node.elementName}${node.content ? ': ' + node.content.substring(0, 20) + '...' : ''}`, // Basic label for default node
            // Pass original data for potential inspection if needed
            attributes: node.attributes,
            content: node.content,
            isLeaf: !node.children || node.children.length === 0,
            originalNode: node,
            elementName: node.elementName, // Ensure elementName is passed
        },
        width: node.width,
        height: node.height,
    };
    flowNodes.push(flowNode);
}); 